package cn.dakaqi.entities;

import cn.dakaqi.entities.user.Volunteer;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by chunyang on 2016/4/13.
 * 系统推广的话题点赞
 */

@Entity
@Table(name = "U_SYS_TOPIC_AGREEN")
public class SysTopicAgreen extends IdEntity
{

    private static final long serialVersionUID = -4597993168055513652L;
    private SysTopic sysTopic;
    private int type;
    private Date createTime;
    private Volunteer volunteer;

    public SysTopicAgreen()
    {
    }

    public SysTopicAgreen(Long id)
    {
        this.id = id;
    }

    @JsonIgnore
    @ManyToOne
    @JoinColumn(name = "SYS_TOPIC_ID")
    public SysTopic getSysTopic()
    {
        return sysTopic;
    }

    public void setSysTopic(SysTopic sysTopic)
    {
        this.sysTopic = sysTopic;
    }

    public int getType()
    {
        return type;
    }

    public void setType(int type)
    {
        this.type = type;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime()
    {
        return createTime;
    }

    public void setCreateTime(Date createTime)
    {
        this.createTime = createTime;
    }

    @JsonIgnore
    @ManyToOne
    @JoinColumn(name = "VOLUNTEER_ID")
    public Volunteer getVolunteer()
    {
        return volunteer;
    }

    public void setVolunteer(Volunteer volunteer)
    {
        this.volunteer = volunteer;
    }
}
